Fix child allocations to be relative to widget position and some drawing
authorOwen Taylor <otaylor@redhat.com>
Fri, 16 Nov 2001 19:19:30 +0000 (19:19 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Fri, 16 Nov 2001 19:19:30 +0000 (19:19 +0000)
Fri Nov 16 14:06:31 2001  Owen Taylor  <otaylor@redhat.com>

* gtk/gtknotebook.c: Fix child allocations to be relative to
widget position and some drawing bugs.

* gtk/gtkmenuitem.c (gtk_menu_item_paint): Fix problem
with reading uninitialized variable.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkmenuitem.c
gtk/gtknotebook.c

index 8f791a2d950d204e1e7751dbf9bb90628c429042..832843e7296b24ee242f2ca41663e2c5a963b2f7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Fri Nov 16 14:06:31 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c: Fix child allocations to be relative to 
+       widget position and some drawing bugs.
+
+       * gtk/gtkmenuitem.c (gtk_menu_item_paint): Fix problem
+       with reading uninitialized variable.
+
 Fri Nov 16 00:16:40 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/{gtkmenuitem.[ch],gtkcheckmenuitem.c,gtkimagemenuitem.c,
index 8f791a2d950d204e1e7751dbf9bb90628c429042..832843e7296b24ee242f2ca41663e2c5a963b2f7 100644 (file)
@@ -1,3 +1,11 @@
+Fri Nov 16 14:06:31 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c: Fix child allocations to be relative to 
+       widget position and some drawing bugs.
+
+       * gtk/gtkmenuitem.c (gtk_menu_item_paint): Fix problem
+       with reading uninitialized variable.
+
 Fri Nov 16 00:16:40 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/{gtkmenuitem.[ch],gtkcheckmenuitem.c,gtkimagemenuitem.c,
index 8f791a2d950d204e1e7751dbf9bb90628c429042..832843e7296b24ee242f2ca41663e2c5a963b2f7 100644 (file)
@@ -1,3 +1,11 @@
+Fri Nov 16 14:06:31 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c: Fix child allocations to be relative to 
+       widget position and some drawing bugs.
+
+       * gtk/gtkmenuitem.c (gtk_menu_item_paint): Fix problem
+       with reading uninitialized variable.
+
 Fri Nov 16 00:16:40 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/{gtkmenuitem.[ch],gtkcheckmenuitem.c,gtkimagemenuitem.c,
index 8f791a2d950d204e1e7751dbf9bb90628c429042..832843e7296b24ee242f2ca41663e2c5a963b2f7 100644 (file)
@@ -1,3 +1,11 @@
+Fri Nov 16 14:06:31 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c: Fix child allocations to be relative to 
+       widget position and some drawing bugs.
+
+       * gtk/gtkmenuitem.c (gtk_menu_item_paint): Fix problem
+       with reading uninitialized variable.
+
 Fri Nov 16 00:16:40 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/{gtkmenuitem.[ch],gtkcheckmenuitem.c,gtkimagemenuitem.c,
index 8f791a2d950d204e1e7751dbf9bb90628c429042..832843e7296b24ee242f2ca41663e2c5a963b2f7 100644 (file)
@@ -1,3 +1,11 @@
+Fri Nov 16 14:06:31 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c: Fix child allocations to be relative to 
+       widget position and some drawing bugs.
+
+       * gtk/gtkmenuitem.c (gtk_menu_item_paint): Fix problem
+       with reading uninitialized variable.
+
 Fri Nov 16 00:16:40 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/{gtkmenuitem.[ch],gtkcheckmenuitem.c,gtkimagemenuitem.c,
index 8f791a2d950d204e1e7751dbf9bb90628c429042..832843e7296b24ee242f2ca41663e2c5a963b2f7 100644 (file)
@@ -1,3 +1,11 @@
+Fri Nov 16 14:06:31 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c: Fix child allocations to be relative to 
+       widget position and some drawing bugs.
+
+       * gtk/gtkmenuitem.c (gtk_menu_item_paint): Fix problem
+       with reading uninitialized variable.
+
 Fri Nov 16 00:16:40 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/{gtkmenuitem.[ch],gtkcheckmenuitem.c,gtkimagemenuitem.c,
index 8f791a2d950d204e1e7751dbf9bb90628c429042..832843e7296b24ee242f2ca41663e2c5a963b2f7 100644 (file)
@@ -1,3 +1,11 @@
+Fri Nov 16 14:06:31 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtknotebook.c: Fix child allocations to be relative to 
+       widget position and some drawing bugs.
+
+       * gtk/gtkmenuitem.c (gtk_menu_item_paint): Fix problem
+       with reading uninitialized variable.
+
 Fri Nov 16 00:16:40 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/{gtkmenuitem.[ch],gtkcheckmenuitem.c,gtkimagemenuitem.c,
index 13c21bb66fa31dbd7f40a1d21d159437d2f7e287..d962806fd07e25a19d66ff60d17e2c38b1ccda3d 100644 (file)
@@ -580,7 +580,7 @@ gtk_menu_item_paint (GtkWidget    *widget,
   GtkShadowType shadow_type;
   gint width, height;
   gint x, y;
-  gint border_width = GTK_CONTAINER (menu_item)->border_width;
+  gint border_width = GTK_CONTAINER (widget)->border_width;
 
   if (GTK_WIDGET_DRAWABLE (widget))
     {
index ca9b40f3aef51b3d385c4356f116911d83d1e69f..0bf40fc84d65313048c57c4f2f1d3247b5a22262 100644 (file)
@@ -1104,15 +1104,7 @@ static void
 gtk_notebook_size_allocate (GtkWidget     *widget,
                            GtkAllocation *allocation)
 {
-  GtkNotebook *notebook;
-  GtkNotebookPage *page;
-  GtkAllocation child_allocation;
-  GList *children;
-
-  g_return_if_fail (GTK_IS_NOTEBOOK (widget));
-  g_return_if_fail (allocation != NULL);
-
-  notebook = GTK_NOTEBOOK (widget);
+  GtkNotebook *notebook = GTK_NOTEBOOK (widget);
 
   widget->allocation = *allocation;
   if (GTK_WIDGET_REALIZED (widget))
@@ -1127,10 +1119,15 @@ gtk_notebook_size_allocate (GtkWidget     *widget,
 
   if (notebook->children)
     {
-      child_allocation.x = GTK_CONTAINER (widget)->border_width;
-      child_allocation.y = GTK_CONTAINER (widget)->border_width;
-      child_allocation.width = MAX (1, allocation->width - child_allocation.x * 2);
-      child_allocation.height = MAX (1, allocation->height - child_allocation.y * 2);
+      gint border_width = GTK_CONTAINER (widget)->border_width;
+      GtkNotebookPage *page;
+      GtkAllocation child_allocation;
+      GList *children;
+      
+      child_allocation.x = widget->allocation.x + border_width;
+      child_allocation.y = widget->allocation.y + border_width;
+      child_allocation.width = MAX (1, allocation->width - border_width * 2);
+      child_allocation.height = MAX (1, allocation->height - border_width * 2);
 
       if (notebook->show_tabs || notebook->show_border)
        {
@@ -2349,8 +2346,8 @@ gtk_notebook_paint (GtkWidget    *widget,
 
   x = widget->allocation.x + border_width;
   y = widget->allocation.y + border_width;
-  width = widget->allocation.width - x * 2;
-  height = widget->allocation.height - y * 2;
+  width = widget->allocation.width - border_width * 2;
+  height = widget->allocation.height - border_width * 2;
 
   if (notebook->show_border && (!notebook->show_tabs || !notebook->children))
     {
@@ -2637,13 +2634,14 @@ gtk_notebook_pages_allocate (GtkNotebook   *notebook)
   if (!notebook->show_tabs || !notebook->children || !notebook->cur_page)
     return;
 
-  child_allocation.x = container->border_width;
-  child_allocation.y = container->border_width;
+  child_allocation.x = widget->allocation.x + container->border_width;
+  child_allocation.y = widget->allocation.y + container->border_width;
 
   switch (notebook->tab_pos)
     {
     case GTK_POS_BOTTOM:
-      child_allocation.y = (allocation->height -
+      child_allocation.y = (widget->allocation.y +
+                           allocation->height -
                            notebook->cur_page->requisition.height -
                            container->border_width);
       /* fall through */
@@ -2652,7 +2650,8 @@ gtk_notebook_pages_allocate (GtkNotebook   *notebook)
       break;
       
     case GTK_POS_RIGHT:
-      child_allocation.x = (allocation->width -
+      child_allocation.x = (widget->allocation.x +
+                           allocation->width -
                            notebook->cur_page->requisition.width -
                            container->border_width);
       /* fall through */